<%
=begin
apps: postgresql-ha
platforms: kubernetes, tanzu-application-catalog
id: initialize_instance
title: Initialize a fresh instance
category: administration
weight: 20
=end %>

The [<%= variable :catalog_name, :platform %> PostgreSQL with Repmgr](https://github.com/bitnami/bitnami-docker-postgresql-repmgr) image allows you to use your custom scripts to initialize a fresh instance. In order to execute the scripts, they must be located inside the chart folder *files/docker-entrypoint-initdb.d* so they can be consumed as a ConfigMap.

Alternatively, you can specify custom scripts using the initdbScripts parameter as dict.

In addition to these options, you can also set an external ConfigMap with all the initialization scripts. This is done by setting the postgresql.initdbScriptsCM parameter. Note that this will override the two previous options. If your initialization scripts contain sensitive information such as credentials or passwords, you can use the initdbScriptsSecret parameter.

The allowed extensions are *.sh*, *.sql* and *.sql.gz*.
